*****************
* Preliminaries *
*****************

* packages
*ssc install listtab,replace
*ssc install boottest, replace
*ssc install reghdfe, replace
*ssc install ftools, replace
*ssc install mylabels, replace
*ssc install coefplot, replace
* grc1leg installation:
*net from http://www.stata.com
*net cd users
*net cd vwiggins
*net install grc1leg

*****************
* preliminaries *
*****************

* filepaths
* --------
set more off
set seed 123

* set your working directory as the location containing the replication folder
capture cd "/Users/gkd225/Dropbox/SGA/Replication_IO"

global dopath = "Do"
global clean = "Data"
global output "Output"

* settings and graphics
clear
set more off
eststo clear

set scheme lean2


* regression controls
* -------------------
global c_geo c.mean_crop1820 c.mean_pop1820 i.chemin_fer c.dist2coast c.mean_elevm c.date c.area_log i.cap_dept i.cap_arron
global geo mean_crop1820 mean_pop1820 chemin_fer dist2coast mean_elevm date area_log cap_dept cap_arron


* --------- *
* Main Text *
* --------- *

* FIGURE1: Casualty Share Over Time
do "${dopath}/Figure1.do"

* Descriptive Table 1
* -----------------
*do "${dopath}/Table1.do"

* Pretrends: Pensions, Table 2
* -----------------
do "${dopath}/Table2.do"

* Pretrends: Public Assistance, Table 3
* -----------------
do "${dopath}/Table3.do"

* DiD Table 4
* -----------------
do "${dopath}/Table4.do"

* FIGURE2: Cumulative Casualties,1919
do "${dopath}/Figure2.do"

* FE Casualty Data Table 5
* -----------------
do "${dopath}/Table5.do"


* -------- *
* Appendix *
* -------- *

* Descriptive Statistics Table A1
* -----------------
do "${dopath}/TableA1.do"

* Correlation Matrix Table A2
* -----------------
do "${dopath}/TableA2.do"

* Balance Table A3
* -----------------
do "${dopath}/TableA3.do"

* Balance Table A4
* -----------------
do "${dopath}/TableA4.do"

* Pretrends Table A5
* -----------------
do "${dopath}/TableA5.do"

* Pretrends Table A6
* -----------------
do "${dopath}/TableA6.do"

* Pretrends Table A7
* -----------------
do "${dopath}/TableA7.do"

* Pretrends Table A8
* -----------------
do "${dopath}/TableA8.do"

* TWFE Table A9
* -----------------
do "${dopath}/TableA9.do"

* DiD Full Table A10
* -----------------
do "${dopath}/TableA10.do"

* Figure A1
* -----------------
* The map in Figure A1 was created using CGIS. The data necessary for reproducing the figure are in the data folder
* titled "FigureA1.csv"

* Figure A3
* -----------------
do "${dopath}/FigureA3.do"

* Figure A4
* -----------------
do "${dopath}/FigureA4.do"

* Figure A5
* -----------------
do "${dopath}/FigureA5.do"

* Figure A6
* -----------------
do "${dopath}/FigureA6.do"

* DiD Decomp Table A11
* -----------------
do "${dopath}/TableA11.do"

* TWFE Table A12
* -----------------
do "${dopath}/TableA12.do"

* TWFE Table A13
* -----------------
do "${dopath}/TableA13.do"

* Figure A7
* -----------------
do "${dopath}/FigureA7.do"

* Figure A8
* -----------------
do "${dopath}/FigureA8.do"
